<template>
  <div class="app-container">
     <!-- <div class="detail-title">自定义方法模块</div> -->
    <div class="container">
      <div class="container-warp container-left" style="height: 245px;padding: 5px 10px 0;width:100%">
        <div class="table-title">结构</div>
        <el-row :gutter="20">
          <el-col :span="24" class="material-form">
            <el-form ref="mform" :model="form" label-width="80px" :inline="true" label-position="left" :rules="mrules">
              <el-form-item prop="dkzylsxplqd">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="母材抵抗正应力致失效的疲劳强度σW,M [MPa]" placement="top" effect="light">
                      <div>
                        σW,M
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.dkzylsxplqd" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="jghd">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="结构厚度，[mm]" placement="top" effect="light">
                      <div>
                        t
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.jghd" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="hjpxzyllxzs">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受平行于绗缝方向的正应力类型指数" placement="top" effect="light">
                      <div>
                        x1
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.hjpxzyllxzs" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="hjczzyllxzs">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受垂直于绗缝方向的正应力类型指数" placement="top" effect="light">
                      <div>
                        x2
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.hjczzyllxzs" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="hjqyllxzs">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受切应力类型指数" placement="top" effect="light">
                      <div>
                        x3
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.hjqyllxzs" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="zylxzxs">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="平均正应力敏感系数Mσ " placement="top" effect="light">
                      <div>
                        Mσ
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zylxzxs" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="qylxzxs">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="平均剪应力敏感系数Mτ" placement="top" effect="light">
                      <div>
                        Mτ
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.qylxzxs" placeholder="" type="number"></el-input>
              </el-form-item>

              <el-form-item prop="zminx">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="母材承受X轴向的正应力最小值，[MPa]" placement="top" effect="light">
                      <div>
                        σXmin
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zminx" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="zmaxx">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="母材承受X轴向的正应力最大值，[MPa]" placement="top" effect="light">
                      <div>
                        σXmax
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zmaxx" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="zminy">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="母材承受Y轴向的正应力最小值，[MPa]" placement="top" effect="light">
                      <div>
                        σYmin
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zminy" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="zmaxy">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="母材承受Y轴向的正应力最大值，[MPa]" placement="top" effect="light">
                      <div>
                        σYmax
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zmaxy" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="mcqmin">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="母材承受切应力最小值，[MPa]" placement="top" effect="light">
                      <div>
                        τXYmin
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.mcqmin" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="mcqmax">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="母材承受切应力最大值，[MPa]" placement="top" effect="light">
                      <div>
                        τXYmax
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.mcqmax" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="mcqdpjxs">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="母材结构强度评价系数" placement="top" effect="light">
                      <div>
                        fv
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.mcqdpjxs" placeholder="" type="number"></el-input>
              </el-form-item>

              <el-form-item prop="zpxmin">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受平行于绗缝方向的正应力最小值[MPa]" placement="top" effect="light">
                      <div>
                        σ‖min
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zpxmin" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="zpxmax">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受平行于绗缝方向的正应力最大值[MPa]" placement="top" effect="light">
                      <div>
                        σ‖max
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zpxmax" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="zczmin">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受垂直于绗缝方向的正应力最小值[MPa]" placement="top" effect="light">
                      <div>
                        σ⊥min
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zczmin" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="zczmax">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受垂直于绗缝方向的正应力最大值[MPa]" placement="top" effect="light">
                      <div>
                        σ⊥max
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.zczmax" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="hjqmin">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受切应力最小值[MPa]" placement="top" effect="light">
                      <div>
                        τmin
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.hjqmin" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="hjqmax">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头承受切应力最大值[MPa]" placement="top" effect="light">
                      <div>
                        τmax
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.hjqmax" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-form-item prop="hjqdpjxs">
                <template solt="label">
                  <div class="label-subscript">
                    <el-tooltip content="焊接接头结构强度评价系数" placement="top" effect="light">
                      <div>
                        fv
                      </div>
                    </el-tooltip>
                  </div>
                </template>
                <el-input v-model="form.hjqdpjxs" placeholder="" type="number"></el-input>
              </el-form-item>
              <el-button type="primary" @click="count(form)"> <svg-icon icon-class="line-bar"/>计算</el-button>
            </el-form>
          </el-col>
        </el-row>
      </div>
    </div>
    <div class="line-warp"></div>
    <div class="container container-bottom">
      <div class="container-warp container-left" style="height: 100%">
        <div class="label-title">强度评价</div>
        <div class="label-log-form" v-if="showResult == true">
          <el-form ref="form" label-width="160px" :inline="true" label-position="left">
            <el-form-item label="">
              <template solt="label">
                <div class="label-subscript">
                  <el-tooltip content="母材抵抗X轴向正应力致失效的疲劳强度的利用率" placement="top" effect="light">
                    <div>
                      URMX
                    </div>
                  </el-tooltip>
                </div>
              </template>
              {{k2}}
            </el-form-item>
            <el-form-item label="">
              <template solt="label">
                <div class="label-subscript">
                  <el-tooltip content="母材抵抗Y轴向正应力致失效的疲劳强度的" placement="top" effect="light">
                    <div>
                      URMY
                    </div>
                  </el-tooltip>
                </div>
              </template>
              {{k3}}
            </el-form-item>
            <el-form-item label="">
              <template solt="label">
                <div class="label-subscript">
                  <el-tooltip content="母材结构抗剪疲劳强度的综合利用率" placement="top" effect="light">
                    <div>
                      URMτ
                    </div>
                  </el-tooltip>
                </div>
              </template>
              {{k4}}
            </el-form-item>
            <el-form-item label="">
              <template solt="label">
                <div class="label-subscript">
                  <el-tooltip content="母材结构疲劳强度的综合利用率" placement="top" effect="light">
                    <div>
                      URM
                    </div>
                  </el-tooltip>
                </div>
              </template>
              {{k5}}
            </el-form-item>
            <el-form-item label="">
              <template solt="label">
                <div class="label-subscript">
                  <el-tooltip content="焊接接头抵抗平行于绗缝方向的正应力致失效的疲劳强度利用率" placement="top" effect="light">
                    <div>
                      URWσ‖
                    </div>
                  </el-tooltip>
                </div>
              </template>
              {{k6}}
            </el-form-item>
            <el-form-item label="">
              <template solt="label">
                <div class="label-subscript">
                  <el-tooltip content="焊接接头抵抗垂直于绗缝方向的正应力致失效的疲劳强度利用率" placement="top" effect="light">
                    <div>
                      URWσ⊥
                    </div>
                  </el-tooltip>
                </div>
              </template>
              {{k7}}
            </el-form-item>
            <el-form-item label="">
              <template solt="label">
                <div class="label-subscript">
                  <el-tooltip content="焊接接头抗剪疲劳强度利用率" placement="top" effect="light">
                    <div>
                      URWτ
                    </div>
                  </el-tooltip>
                </div>
              </template>
              {{k8}}
            </el-form-item>
            <el-form-item label="">
              <template solt="label">
                <div class="label-subscript">
                  <el-tooltip content="焊接接头结构强度综合利用率 " placement="top" effect="light">
                    <div>
                      URM
                    </div>
                  </el-tooltip>
                </div>
              </template>
              {{k9}}
            </el-form-item>
          </el-form>
        </div>
        <div  v-if="showResult == true" class="log-warp" :style="'height:'+(logContentHeight-70)+'px'">
          <div class="log-content divcontainer wrap-text" style="white-space:pre">
            <span class="badge" @click="showLogModel">
              <img src="@/assets/images/big_X.png" style="width: 30px;height: 30px;">
              </span>
            {{ logText }}
          </div>
        </div>
        <!-- <el-button type="primary" class="detail-center-btn" >
          <svg-icon icon-class="user-list"/>
          打开日志文件
        </el-button> -->
      </div>
      <div class="container-warp container-right">
        <div class="label-title" style="margin-bottom: 10px">疲劳强度MKJ图</div>
        <el-carousel  v-if="showResult == true" arrow="always" class="chart-warp" :style="'height:'+(logContentHeight+50)+'px'">
          <el-carousel-item v-for="item in 3" :key="item">
            <!-- <h3 class="small">{{ item }}</h3> -->
            <!-- {{ logContentHeight }} -->
            <sn-chart :chartData="getChartDataForItem(item)"  ref="snchart"/>
          </el-carousel-item>
        </el-carousel>
      </div>
    </div>
    <el-dialog
      width="80%"
      title="日志"
      :visible.sync="logModel"
      >
      <div class="wrap-text" :style="'height:'+ heightTestData +'px;overflow-y: auto;white-space:pre'">
        {{ logText }}
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import service from "@/api/material";
  import SnChart from "./snChart";
  export default {
    name: "Dvs160826",
    components: {
      SnChart
    },
    props: {
      data: {
        type: Object
      },
      // 值
      value: [String, Object, Array],
      // 数量限制
      limit: {
        type: Number,
        default: 1,
      },
      // 大小限制(MB)
      fileSize: {
        type: Number,
        default: 5,
      },
      // 文件类型, 例如['png', 'jpg', 'jpeg']
      fileType: {
        type: Array,
        default: () => ["xlsx", "xls"],
      },
    },
    data() {
      return {
        showTip: false,
        mrules:{
          dkzylsxplqd: [{
            required: true,
            message: '母材抵抗正应力致失效的疲劳强度不能为空',
            trigger: 'blur'
          }],
          jghd: [{
            required: true,
            message: '结构厚度不能为空',
            trigger: 'blur'
          }],
          hjpxzyllxzs: [{
            required: true,
            message: '焊接接头承受平行于绗缝方向的正应力类型指数不能为空',
            trigger: 'blur'
          }],
          hjczzyllxzs: [{
            required: true,
            message: '焊接接头承受垂直于绗缝方向的正应力类型指数不能为空',
            trigger: 'blur'
          }],
          hjqyllxzs: [{
            required: true,
            message: '焊接接头承受切应力类型指数不能为空',
            trigger: 'blur'
          }],
          zylxzxs: [{
            required: true,
            message: '平均正应力修正系数不能为空',
            trigger: 'blur'
          }],
          qylxzxs: [{
            required: true,
            message: '平均切应力修正系数不能为空',
            trigger: 'blur'
          }],
          zminx: [{
            required: true,
            message: '母材承受X轴向的正应力最小值，[MPa]不能为空',
            trigger: 'blur'
          }],
          zmaxx: [{
            required: true,
            message: '母材承受X轴向的正应力最大值，[MPa]不能为空',
            trigger: 'blur'
          }],
          zminy: [{
            required: true,
            message: '母材承受Y轴向的正应力最小值，[MPa]不能为空',
            trigger: 'blur'
          }],
          zmaxy: [{
            required: true,
            message: '母材承受Y轴向的正应力最大值，[MPa]不能为空',
            trigger: 'blur'
          }],
          mcqmin: [{
            required: true,
            message: '母材承受切应力最小值，[MPa]不能为空',
            trigger: 'blur'
          }],
          mcqmax: [{
            required: true,
            message: '母材承受切应力最大值，[MPa]不能为空',
            trigger: 'blur'
          }],
          mcqdpjxs: [{
            required: true,
            message: '母材结构强度评价系数不能为空',
            trigger: 'blur'
          }],
          zpxmin: [{
            required: true,
            message: '焊接接头承受平行于绗缝方向的正应力最小值不能为空',
            trigger: 'blur'
          }],
          zpxmax: [{
            required: true,
            message: '焊接接头承受平行于绗缝方向的正应力最大值不能为空',
            trigger: 'blur'
          }],
          zczmin: [{
            required: true,
            message: '焊接接头承受垂直于绗缝方向的正应力最小值不能为空',
            trigger: 'blur'
          }],
          zczmax: [{
            required: true,
            message: '焊接接头承受垂直于绗缝方向的正应力最大值不能为空',
            trigger: 'blur'
          }],
          hjqmin: [{
            required: true,
            message: '焊接接头承受切应力最小值不能为空',
            trigger: 'blur'
          }],
          hjqmax: [{
            required: true,
            message: '焊接接头承受切应力最大值不能为空',
            trigger: 'blur'
          }],
          hjqdpjxs: [{
            required: true,
            message: '焊接接头结构强度评价系数不能为空',
            trigger: 'blur'
          }],
        },
        form:{},
        item: [1],
        logText: '',
        moduleClassSelectList: [
          {value: 'BS7608_003', label: 'BS7608室温环境钢结构疲劳寿命预测',},
          {value: 'BS7608_004', label: 'BS7608海水环境钢结构疲劳寿命预测',},
          {value: 'BS7608_005', label: 'BS7608改进性能后焊接接头疲劳寿命预测',},
        ],
        JGSelectList: [
          {value: 0, label: '不修正',},
          {value: 1, label: '修正',},
        ],
        IMSelectList: [
          {value: 1, label: '细晶结构钢',},
          {value: 2, label: '不锈钢',},
          {value: 3, label: '淬火钢',},
          {value: 4, label: '锻钢',},
          {value: 5, label: '其他钢',},
          {value: 6, label: '一般用途铸钢和热处理铸钢',},
          {value: 7, label: '球墨铸铁',},
          {value: 8, label: '可锻铸铁',},
          {value: 9, label: '片状石墨铸铁',},
          {value: 10, label: '挤压铝合金',},
          {value: 11, label: '变形铝合金',},
        ],
        logModel: false,
        wdModel1: false,
        wdModel2: false,
        dllModel: false,
        heightTestData: '',
        logContentHeight: '',
        number: 0,
        uploadList: [],
        fileList: [],
        dl: '',
        ts: '',
        abk: '',
        loglineChartData: {},
        showResult: false,
        showSN: false,
        k0: null,
        k1: null,
        k2: null,
        k3: null,
        k4: null,
        k5: null,
        k6: null,
        k7: null,
        k8: null,
        k9: null,
        loglineChartData1: {},
        loglineChartData2: {},
        loglineChartData3: {},
        loglineChartData4: {},
        selectedLabel1: "MKJ",
        selectedLabel2: "MKJ",
        selectedLabel3: "MKJ",
      };
    },
    created() {
      this.logContentHeight = window.innerHeight - 570
    },
    watch: {
      value: {
        handler(val) {
          if (val) {
            let temp = 1;
            // 首先将值转为数组
            const list = Array.isArray(val) ? val : this.value.split(',');
            // 然后将数组转为对象数组
            this.fileList = list.map(item => {
              if (typeof item === "string") {
                item = { name: item, url: item };
              }
              item.uid = item.uid || new Date().getTime() + temp++;
              return item;
            });
          } else {
            this.fileList = [];
            return [];
          }
        },
        deep: true,
        immediate: true
      }
    },
    mounted() {
      this.$nextTick(()=>{
        this.heightTestData = window.innerHeight - 300
      })
      this.showResult = false
      this.showSN = false
    },
    methods: {
      getChartDataForItem(item) {
          return this[`loglineChartData${item}`];

      },
      showWdModel1() {
        this.wdModel1 = true
      },
      showWdModel2() {
        this.wdModel2 = true
      },
      showLogModel() {
        this.logModel = true
      },
      // 上传前校检格式和大小
      handleBeforeUpload(file) {
        // 校检文件类型
        if (this.fileType) {
          const fileName = file.name.split('.');
          const fileExt = fileName[fileName.length - 1];
          const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
          if (!isTypeOk) {
            this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
            return false;
          }
        }
        // 校检文件大小
        if (this.fileSize) {
          const isLt = file.size / 1024 / 1024 < this.fileSize;
          if (!isLt) {
            this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
            return false;
          }
        }
        // this.$modal.loading("正在上传文件，请稍候...");
        // this.number++;
        this.fileList = [file]
        return true;
      },
      // 文件个数超出
      handleExceed() {
        this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
      },
      // 获取文件名称
      getFileName(name) {
        // 如果是url那么取最后的名字 如果不是直接返回
        if (name.lastIndexOf("/") > -1) {
          return name.slice(name.lastIndexOf("/") + 1);
        } else {
          return name;
        }
      },
      // 对象转成指定字符串分隔
      listToString(list, separator) {
        let strs = "";
        separator = separator || ",";
        for (let i in list) {
          strs += list[i].url + separator;
        }
        return strs != '' ? strs.substr(0, strs.length - 1) : '';
      },
      computeParamHD(form){
        var that = this
        this.$refs.wform.validate(valid => {
          if (!valid) return
          let formData = new FormData()
          formData.append('wd',form.wd)
          formData.append('materialtype',form.materialtype)
          service.computeParamWD(formData).then(res => {
            this.$set(this.form, "ktb", res.data.value)
            this.wdModel1 = false
          }).catch((err)=>{
            if(err.code == 500){
              that.$modal.msgError(err.mas);
            }
          })
        })
      },
      computeParamWD(form){
        var that = this
        this.$refs.wform.validate(valid => {
          if (!valid) return
          let formData = new FormData()
          formData.append('wd',form.wd)
          formData.append('materialtype',form.materialtype)
          service.computeParamWD(formData).then(res => {
            this.$set(this.form, "kt", res.data.value)
            this.wdModel2 = false
          }).catch((err)=>{
            if(err.code == 500){
              that.$modal.msgError(err.mas);
            }
          })
        })
      },
      count(form){
        this.$refs.mform.validate(valid2 => {
          if (!valid2) return
          let formData = new FormData()
          formData.append('zylxzxs',form.zylxzxs)
          formData.append('qylxzxs',form.qylxzxs)
          formData.append('dkzylsxplqd',form.dkzylsxplqd)
          formData.append('zminx',form.zminx)
          formData.append('zmaxx',form.zmaxx)
          formData.append('zminy',form.zminy)
          formData.append('zmaxy',form.zmaxy)
          formData.append('mcqmin',form.mcqmin)
          formData.append('mcqmax',form.mcqmax)
          formData.append('mcqdpjxs',form.mcqdpjxs)
          formData.append('jghd',form.jghd)
          formData.append('hjpxzyllxzs',form.hjpxzyllxzs)
          formData.append('hjczzyllxzs',form.hjczzyllxzs)
          formData.append('hjqyllxzs',form.hjqyllxzs)
          formData.append('zpxmin',form.zpxmin)
          formData.append('zpxmax',form.zpxmax)
          formData.append('zczmin',form.zczmin)
          formData.append('zczmax',form.zczmax)
          formData.append('hjqmin',form.hjqmin)
          formData.append('hjqmax',form.hjqmax)
          formData.append('hjqdpjxs',form.hjqdpjxs)
          service.dvs160826MoudleForecast(formData).then(res => {
            this.showResult = true
            this.showSN = true
            this.logText = res.data.contents
            this.loglineChartData.xData = ""
            this.loglineChartData.yData = ""
            this.loglineChartData1.xData = ""
            this.loglineChartData1.yData = ""
            this.loglineChartData1.title = this.selectedLabel1+"SN图1"
            // this.loglineChartData1.xmin = res.data.control[0]
            // this.loglineChartData1.xmax = res.data.control[1]
            // this.loglineChartData1.ymin = res.data.control[2]
            // this.loglineChartData1.ymax = res.data.control[3]
            this.loglineChartData1.data = res.data.sn1

            this.loglineChartData2.xData = ""
            this.loglineChartData2.yData = ""
            this.loglineChartData2.title = this.selectedLabel2+"SN图2"
            // this.loglineChartData2.xmin = res.data.control[0]
            // this.loglineChartData2.xmax = res.data.control[1]
            // this.loglineChartData2.ymin = res.data.control[6]
            // this.loglineChartData2.ymax = res.data.control[7]
            this.loglineChartData2.data = res.data.sn2

            this.loglineChartData3.xData = ""
            this.loglineChartData3.yData = ""
            this.loglineChartData3.title = this.selectedLabel3+"SN图3"
            // this.loglineChartData2.xmin = res.data.control[0]
            // this.loglineChartData2.xmax = res.data.control[1]
            // this.loglineChartData2.ymin = res.data.control[6]
            // this.loglineChartData2.ymax = res.data.control[7]
            this.loglineChartData3.data = res.data.sn3
            this.k2 = res.data.control[2].toExponential()
            this.k3 = res.data.control[3].toExponential()
            this.k4 = res.data.control[4].toExponential()
            this.k5 = res.data.control[5].toExponential()
            this.k6 = res.data.control[6].toExponential()
            this.k7 = res.data.control[7].toExponential()
            this.k8 = res.data.control[8].toExponential()
            this.k9 = res.data.control[9].toExponential()


            this.$nextTick(() => {
              this.$refs.snchart[0].initChart()
            });
          }).catch((err)=>{
            if(err.code == 500){
              that.$modal.msgError(err.mas);
            }

          })
        })
      }
    }
  };
</script>

<style scoped lang="scss">
  .app-container {
    display: block;
    padding: 5px;
    height: calc(100% - 65px);
  }
  .container-bottom{
    height: calc(100% - 295px);
    overflow: hidden;
  }

  .detail-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    font-size: 20px;

    &:before, &:after {
      content: '';
      display: inline-block;
      width: 37%;
      height: 4px;
      border-bottom: 1px solid #BAD7EC;
      border-top: 1px solid #BAD7EC;
    }
  }

  .detail-title-form {
    width: 450px;
    margin: 10px auto;
    ::v-deep .el-form-item{
      margin-bottom: 15px;
    }
    ::v-deep .el-form-item__label {
      color: #084EBC;
      font-weight: normal;
    }
  }

  .container {
    width: 100%;
    display: flex;
    justify-content: space-around;
  }

  .container-warp {
    width: 100%;
    display: inline-block;
    border: 1px solid #ddd;
    background-color: #fff;
    box-shadow: 0 0 5px #eeeeee;
  }

  .container-right {
    .container-warp + .container-warp {
      margin-top: 10px;
    }
  }

  .container-left {
    width: 49%;
  }

  .container-right {
    width: 49%;
  }

  .detail-center-btn {
    display: block;
    width: 260px;
    margin: 6px auto;
  }

  .table-title {
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    height: 26px;
    color: #5184ec;
    text-indent: 10px;
    border-bottom: 1px solid #d5d5d5;
    background: url("../../../assets/images/line.png") no-repeat;
    background-position: -143px 22px;
  }

  .material-pic {
    background-color: #fff;
    border: 1px solid #CCDCE7;
    border-radius: 5px;
    width: 100%;
    max-width: 330px;
    height: 190px;
    margin-top: 15px;
    margin-left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;

    img {
      width: 209.28px;
      height: 173.6px;
    }
  }

  .material-form {
    margin-top: 10px;

    ::v-deep .el-form-item__label {
      font-weight: normal;
    }

    ::v-deep .el-form-item {
      width: 13%;
      margin-bottom: 12px;
    }

    ::v-deep .el-input--medium {
      width: calc(100% - 70px);
    }

    ::v-deep .el-select {
      .el-input--medium {
        width: 100% !important;
      }

      width: calc(100% - 70px) !important;
    }
  }

  .label-title {
    width: 133px;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    height: 26px;
    color: #5184ec;
    text-indent: 10px;
    border-left: 3px solid #166BCE;
    background: url("../../../assets/images/label_bg.png") no-repeat;
    background-size: 100%;
  }


  .log-warp {
    width: 96%;
    margin-left: 2%;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    padding: 5px 10px;
    height: 100%;
    font-size: 14px;
  }

  .label-log-form {
    margin-top: 5px;
    text-align: center;
  }

  .log-warp + .detail-center-btn {
    width: 300px;
  }

  .label-subscript {
    display: inline-block;
    width: 70px;
  }
  .dg-label-subscript {
    display: inline-block;
    width: 100px;
  }

  .structure-form {
    .label-subscript {
      width: 90px;
    }
  }
  ::v-deep .el-form-item--medium .el-form-item__content{
        line-height: 15px !important;
  }

  .structure-form {
    margin-top: 10px;
    padding: 0 10px;



    ::v-deep .el-form-item__label {
      font-weight: normal;
    }

    ::v-deep .el-form-item {
      width: 31%;
      margin-bottom: 5px !important;
    }

    ::v-deep .el-input--medium {
      width: calc(100% - 90px);
      margin-bottom: 5px !important;
    }

    ::v-deep .el-input-group__append {
      padding: 0 6px;
    }

    ::v-deep .el-select {
      .el-input--medium {
        width: 100% !important;
      }

      width: calc(100% - 90px) !important;
    }
    ::v-deep .el-cascader {
      .el-input--medium {
        width: 100% !important;
      }

      width: calc(100% - 90px) !important;
    }

  }

  .dg-structure-form {
    margin-top: 10px;
    padding: 0 10px;

    ::v-deep .el-form-item__label {
      font-weight: normal;
    }

    ::v-deep .el-form-item {
      width: 46%;
      margin-bottom: 5px !important;
    }

    ::v-deep .el-input--medium {
      width: calc(100% - 100px);
      margin-bottom: 5px !important;
    }

    ::v-deep .el-input-group__append {
      padding: 0 6px;
    }
    ::v-deep .el-select {
      .el-input--medium {
        width: 100% !important;
      }

      width: calc(100% - 100px) !important;
    }
  }

  .structure-forms {
    margin-top: 10px;
    padding: 0 10px;

    ::v-deep .el-form-item__label {
      font-weight: normal;
    }

    ::v-deep .el-form-item {
      width: 48%;
      margin-bottom: 15px !important;
    }

    ::v-deep .fy {
      width: 31%;
    }

    /*::v-deep .fy .el-tooltip {*/
    /*  width: 90px !important;*/
    /*}*/

    /*::v-deep .fy .el-input--medium {*/
    /*  width: calc(100% - 90px)  !important;*/
    /*}*/

    ::v-deep .el-form-item__content {
      width: calc(100% - 125px);
    }

    .form-label-tooltip {
      ::v-deep .el-form-item__content {
        width: 100%;
      }

      ::v-deep .el-tooltip {
        width: 50px;
        display: inline-block;
      }

      ::v-deep .el-input--medium {
        width: calc(100% - 50px);
      }
    }
  }
  .divcontainer {
    position: relative;
  }

  .badge {
    position: absolute;
    cursor: pointer;
    top: -5px;
    right: -10px;
    width: 30px;
    height: 30px;
    background-color: #ffffff;
    color: white;
    /* border-radius: 50%; */
    text-align: center;
    line-height: 30px;
  }
  .chart-warp{
    .el-carousel__item{
      width: 80%;
      margin-left: 10%;
    }
  }
  .line-warp{
    width: 98%;
    height: 4px;
    border-top: 1px dashed #bad7ec;
    border-bottom: 1px dashed #bad7ec;
    margin: 6px 1%;
  }
  ::v-deep .el-carousel__container{
    height: 100%;
  }
  .upload-file-uploader {
    margin-bottom: 5px;
    margin-left: auto;
    margin-right: auto;
  }
  .upload-file-list .el-upload-list__item {
    border: 1px solid #e4e7ed;
    line-height: 2;
    margin-bottom: 10px;
    position: relative;
  }
  .upload-file-list .ele-upload-list__item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: inherit;
  }
  .ele-upload-list__item-content-action .el-link {
    margin-right: 10px;
  }
  .fyzh{
    display: inline-flex;
    width: 100%;
  }
  /* CSS 类用于换行 */
  .wrap-text {
    white-space: pre-line;
  }

  /* 用于处理长单词或 URL 的换行 */
  .break-word {
    word-break: break-all;
    overflow-wrap: break-word;
  }

  ::v-deep .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
      // content: '*' !important;
      display: none
  }

</style>
